manifest/raw_bootc: Label / and /boot before running bootc install - #2525
manifest/raw_bootc: Label / and /boot before running bootc install#2525jbtrystram wants to merge 1 commit into
Conversation
b4cc44b to
d564632
Compare
|
Which image types are you seeing a problem with? Please provide a reproducer if possible. Also, have you tested this? I gave it a quick try and it blows up in your new mkdir stage because mounts already create the mountpoint, not need to do it manually. |
d564632 to
cce1e23
Compare
|
@brlane-rht thanks for the review ! I fixed the PR. The mkdir stage is still here because we want to label the mountpoint without anything mounted. So when further files are created in the mounted FS, they inherit the correct SELinux label from the mountpoint. I am building fedora CoreOS using blueprints defined here : https://github.com/joelcapitao/bib-fcos-experimentation/ So for a QEMU image for x86 I have the following blueprint : I am building the image with : With this PR, the resulting labels are corrects : Here is the generated manifest : fedora-coreos-rawhide.osbuild-manifest.json See #2494 |
cce1e23 to
f8614fa
Compare
When SELinux is enabled, insert a few stages before running `bootc install` that will make sure the `root` and `boot` mount points are labelled. This avoid files under `/sysroot` created by bootc to be `unlabeled_t` and this makes sure files under `/boot` created by bootupd inherit the correct `boot_t` label. See osbuild#2494 Assisted-by: Opencode.ai <Opus 4.6>
f8614fa to
1335b47
Compare
|
@brlane-rht since you drafted this I don't want to undraft it without you being involved. Is this OK to review? |
If @jbtrystram thinks it is ready. I drafted it because it looked like it was completely untested. I'm still not sure about it changing this for everything using |
It's ready, i updated and tested it since.
The resulting image do not change much except for files in the ostree repo and /boot |
supakeen
left a comment
There was a problem hiding this comment.
This is OK but it does codify a bit more the expectations we have around /boot, /boot/efi, and such. Not a problem in the current bootc situation but if we move onto things like systemd-gpt-auto-generator and such this will likely need a rework.
mhmm you are right that this might fail in the composefs + systemd-boot path where there is no separate /boot partition. I did not test with such an image |
And maybe even more generally in the native composefs path where there is (if I recall) no Perhaps we should test such an image; you can use one from https://github.com/travier/fedora-atomic-desktops-sealed specifically the I'll retract my ack until we have done so. |
supakeen
left a comment
There was a problem hiding this comment.
Let's test with a sealed image.
|
I tried with a container image built with the PR @supakeen linked above, and it s failing during bootc install : That said, I am not entirely sure the failure is due to this change. |
Sadly it is not, |
|
Also @alexlarsson might want to have a look at this :) |
When SELinux is enabled, insert a few stages before running
bootc installthat will make sure therootandbootmount points are labelled. This avoid files under/sysrootcreated by bootc to beunlabeled_tand this makes sure files under/bootcreated by bootupd inherit the correctboot_tlabel.See #2494
Assisted-by: Opencode.ai <Opus 4.6>